package cn.zwx.strategy.pattern.example.simple;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Service;

/**
 * @projectName:strategy-pattern-example
 * @see:cn.zwx.strategy.pattern.example.simple
 * @author:zhangwenxue
 * @createTime:2022/2/11 10:08
 * @version:1.0
 */
@Service
public class SimpleService {

    private Logger logger = LoggerFactory.getLogger(SimpleService.class);

    /**
     *  模拟查询派发业务
     * @return java.lang.String
     * @author zhangwenxue
     * @createTime 2022/2/11 10:15
     * @thorws
     **/
    public String getResult(String resourceName) {
        switch(resourceName){
            case "红包":
                //查询红包的派发方式
                return "每周末9点发放";
            case "购物券":
                //购物券的发放方式
                return "每周三9点发放";
            case "QQ会员" :
                //qq会员的发放方式
                return "每周一0点开始秒杀";
            case "外卖会员" :
                //外卖会员发放方式
                return "每周四八点开始秒杀";
            default :
                logger.info("查找不到该优惠券类型resourceType以及对应的派发方式");
                return "查找不到该优惠券类型resourceType以及对应的派发方式";
        }
    }
}
